class Test(object):
    instance = None
    init_info = False

    def __new__(cls, *args, **kwargs):
        if cls.instance is None:
            cls.instance = super().__new__(cls)
        return cls.instance

    def __init__(self):   # 多次实例只初始化一次的解决办法
        if Test.init_info:
            return
        print('初始化输出')
        Test.init_info = True


test1 = Test()
print(test1)

test2 = Test()
print(test2)
